<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://text.xiaohuwei.cn/weather/jquery-1.12.4.min.js"></script>
</head>
<body>
    <form id="frm" >
        用户名：<input type="text" name="userName">
        <br>
        密码：<input type="text" name="pwd">
        <br>

<input type="button" id="btn" value="登录">


    </form>
</body>

<script>
$("#btn").click(function(){
$.post("1.php",$("#frm").serialize(),function(res){
    if(res==1){
        alert("登陆成功！");

    }else{
        alert("登陆失败！")
    }
})
})


</script>
</html>